package com.dianping.cat.consumer.top.model.entity;

import com.dianping.cat.consumer.top.model.BaseEntity;
import com.dianping.cat.consumer.top.model.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;




public class Domain
  extends BaseEntity<Domain>
{
  private String m_name;
/* 15 */   private Map<Integer, Segment> m_segments = new LinkedHashMap();





/* 21 */   public Domain(String name) { this.m_name = name; }




/* 26 */   public void accept(IVisitor visitor) { visitor.visitDomain(this); }


  public Domain addSegment(Segment segment) {
/* 30 */     this.m_segments.put(segment.getId(), segment);
/* 31 */     return this;
  }


  public boolean equals(Object obj) {
/* 36 */     if (obj instanceof Domain) {
/* 37 */       Domain _o = (Domain)obj;

/* 39 */       if (!equals(getName(), _o.getName())) {
/* 40 */         return false;
      }

/* 43 */       return true;
    }

/* 46 */     return false;
  }


/* 50 */   public Segment findSegment(Integer id) { return (Segment)this.m_segments.get(id); }


  public Segment findOrCreateSegment(Integer id) {
/* 54 */     Segment segment = (Segment)this.m_segments.get(id);

/* 56 */     if (segment == null) {
/* 57 */       synchronized (this.m_segments) {
/* 58 */         segment = (Segment)this.m_segments.get(id);

/* 60 */         if (segment == null) {
/* 61 */           segment = new Segment(id);
/* 62 */           this.m_segments.put(id, segment);
        }
      }
    }

/* 67 */     return segment;
  }


/* 71 */   public String getName() { return this.m_name; }



/* 75 */   public Map<Integer, Segment> getSegments() { return this.m_segments; }







/* 89 */   public void mergeAttributes(Domain other) { assertAttributeEquals(other, "domain", "name", this.m_name, other.getName()); }




/* 94 */   public Segment removeSegment(Integer id) { return (Segment)this.m_segments.remove(id); }


  public Domain setName(String name) {
/* 98 */     this.m_name = name;
/* 99 */     return this;
  }

  public Domain() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-consumer-3.0.0.jar!/com/dianping/cat/consumer/top/model/entity/Domain.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */